/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ipo.mm.web.util.security;

import java.util.Hashtable;

/**
 *
 * @author makcro
 */
public class ActionPrivilegeMapping {

    private Hashtable<String, Integer> mapping = new Hashtable<String, Integer>();

    public ActionPrivilegeMapping() {

        mapping.put("showMainPage", SecurityManager.SHOW_MAIN_PAGE);
        mapping.put("showCloseWindowPage", SecurityManager.SHOW_CLOSE_PAGE);

        mapping.put("showCreateCityForm", SecurityManager.CREATE_CITY_PRIVILEGE);
        mapping.put("showUpdateCityForm", SecurityManager.EDIT_CITY_PRIVILEGE);
        mapping.put("deleteCity", SecurityManager.DELETE_CITY_PRIVILEGE);
        mapping.put("showCities", SecurityManager.READ_CITY_PRIVILEGE);

        mapping.put("showCreateTypeForm", SecurityManager.CREATE_ITYPE_PRIVILEGE);
        mapping.put("showUpdateTypeForm", SecurityManager.EDIT_ITYPE_PRIVILEGE);
        mapping.put("deleteType", SecurityManager.DELETE_ITYPE_PRIVILEGE);
        mapping.put("showTypes", SecurityManager.READ_ITYPE_PRIVILEGE);

        mapping.put("showCreateRegionForm", SecurityManager.CREATE_IREGION_PRIVILEGE);
        mapping.put("showUpdateRegionForm", SecurityManager.EDIT_IREGION_PRIVILEGE);
        mapping.put("deleteRegion", SecurityManager.DELETE_IREGION_PRIVILEGE);
        mapping.put("showRegions", SecurityManager.READ_IREGION_PRIVILEGE);

        mapping.put("showCreateFamilyForm", SecurityManager.CREATE_IFAMILY_PRIVILEGE);
        mapping.put("showUpdateFamilyForm", SecurityManager.EDIT_IFAMILY_PRIVILEGE);
        mapping.put("deleteFamily", SecurityManager.DELETE_IFAMILY_PRIVILEGE);
        mapping.put("showFamilies", SecurityManager.READ_CITY_PRIVILEGE);

        mapping.put("showCreateUserForm", SecurityManager.CREATE_USER_PRIVILEGE);
        mapping.put("showUpdateUserForm", SecurityManager.EDIT_USER_PRIVILEGE);
        mapping.put("deleteUser", SecurityManager.DELETE_USER_PRIVILEGE);
        mapping.put("showUsers", SecurityManager.READ_USER_PRIVILEGE);

        mapping.put("showCreateInstForm", SecurityManager.CREATE_INSTITUTION_PRIVILEGE);
        mapping.put("showInstitutions", SecurityManager.READ_INSTITUTION_PRIVILEGE);
        mapping.put("showUpdateInstForm", SecurityManager.EDIT_INSTITUTION_PRIVILEGE);
        mapping.put("deleteInstitution", SecurityManager.DELETE_INSTITUTION_PRIVILEGE);

        mapping.put("showCreateReprForm", SecurityManager.CREATE_REPRESENTATIVE_PRIVILEGE);
        mapping.put("showReprs", SecurityManager.READ_REPRESENTATIVE_PRIVILEGE);
        mapping.put("deleteRepresentative", SecurityManager.DELETE_REPRESENTATIVE_PRIVILEGE);
        mapping.put("showUpdateReprForm", SecurityManager.EDIT_REPRESENTATIVE_PRIVILEGE);

        mapping.put("showCreateMeetingForm", SecurityManager.CREATE_MEETING_PRIVILEGE);
        mapping.put("showMeetings", SecurityManager.READ_MEETING_PRIVILEGE);
        mapping.put("deleteMeeting", SecurityManager.DELETE_MEETING_PRIVILEGE);
        mapping.put("showUpdateMeetingForm", SecurityManager.EDIT_MEETING_PRIVILEGE);

        mapping.put("showSendMail", SecurityManager.SEND_BULK_MAIL_PRIVILEGE);
        mapping.put("showPrintPostMail", SecurityManager.PRINT_MAIL_PRIVILEGE);
        mapping.put("showPrintPostMailInst", SecurityManager.PRINT_MAIL_PRIVILEGE_INST);
        mapping.put("readLog", SecurityManager.READ_LOG_PRIVILEGE);
        mapping.put("showUpdateActionsForm", SecurityManager.EDIT_ACTIONS_PRIVILEGE);
        mapping.put("readActions", SecurityManager.READ_ACTIONS_PRIVILEGE);
        mapping.put("showCreateActionsForm", SecurityManager.CREATE_ACTIONS_PRIVILEGE);
        mapping.put("deleteActions", SecurityManager.DELETE_ACTIONS_PRIVILEGE);
        mapping.put("displayReport",SecurityManager.DISPLAY_REPORT_PRIVILEGE);
        mapping.put("showDisplayMeetingForm", SecurityManager.DISPLAY_MEETING_PRIVILEGE);
        mapping.put("showReportsMenu", SecurityManager.DISPLAY_REPORTS_MENU_PRIVILEGE);
        mapping.put("viewCityForm",SecurityManager.VIEW_CITY_PRIVILEGE);
        mapping.put("viewFamilyForm",SecurityManager.VIEW_IFAMILY_PRIVILEGE);
        mapping.put("viewInstForm",SecurityManager.VIEW_INSTITUTION_PRIVILEGE);
        mapping.put("viewRegionForm",SecurityManager.VIEW_IREGION_PRIVILEGE);
        mapping.put("viewTypeForm",SecurityManager.VIEW_ITYPE_PRIVILEGE);
        mapping.put("viewMeetingForm",SecurityManager.VIEW_MEETING_PRIVILEGE);
        mapping.put("viewReprForm",SecurityManager.VIEW_REPRESENTATIVE_PRIVILEGE);
        mapping.put("showSendMailInstitution", SecurityManager.SEND_BULK_MAIL_PRIVILEGE_INST);


    }

    public Integer getPrivilegeForAction(String action) {
        return mapping.get(action);
    }
}
